<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>首页</title>
    <link href="${ pageContext.request.contextPath}/web/assets/css/base.css" type="text/css" rel="stylesheet">
    <link href="${ pageContext.request.contextPath}/web/assets/css/style.css" type="text/css" rel="stylesheet">
    <link href="${ pageContext.request.contextPath}/web/assets/css/banner.css" type="text/css" rel="stylesheet">
    <script src="${ pageContext.request.contextPath}/web/assets/jquery.min.js"></script>
    <script src="${ pageContext.request.contextPath}/web/assets/banner.js"></script>
    <script>
        function star(id,entityName='${ entityName}') {
            $.ajax({
                url: "${ pageContext.request.contextPath}/"+welcome,
                data: {action: 'star', id,entityName},
                // contentType: "application/json",
                type: "GET",
                success: function (data) {
                    alert(data.message);
                }
            });
        }
    </script>
</head>
<body>
<!-- 页面头部 -->
<jsp:include page="./c-head.jsp"></jsp:include>

<div class="main-banner">
    <!--轮播图整体div-->
    <div class="banner">
        <!--无序列表承载轮播的图片-->
        <ul class="banner-img">
            <li><a href="#"><img src="${ pageContext.request.contextPath}/web/assets/img/b1.jpg"></a></li>
            <li><a href="#"><img src="${ pageContext.request.contextPath}/web/assets/img/b2.jpg"></a></li>
            <li><a href="#"><img src="${ pageContext.request.contextPath}/web/assets/img/b3.jpg"></a></li>
        </ul>
        <!--用来放置圆点具体实施在js代码中呈现-->
        <ul class="banner-num"></ul>
        <!--左右点击按钮-->
        <div class="banner-btn">
            <span class="banner-prev"><</span>
            <span class="banner-next">></span>
        </div>
    </div>
    <div class="main-banner-notice">
        <div><h3>通知公告</h3></div>
<c:forEach items="${ notices }" var="i" varStatus="s">
        <div>
            <h5>${ i.title }</h5>
            <p>${ i.content }</p>
        </div>
</c:forEach>
    </div>
</div>

<div class="main-content">
    <div class="m-body">
        <div class="content-title">
            <h2>热门</h2>
        </div>
        <div class="content-l">
<c:forEach items="${ hotList }" var="i" varStatus="s">
            <div class="content-l-item">
                    <a href="${ pageContext.request.contextPath}/welcome?entityName=${ entityName}&id=${ i.itemid}">
                        <img src="${ pageContext.request.contextPath}/file?filename=${ i.showpic}">
                        <p class="content-l-item-title" title="${ i.showtitle}">${ i.showtitle}</p>
                        <p class="content-l-item-tip" >${ i.showdesc}</p>
                        <p class="content-l-item-tip" >收藏：${ i.count}</p>
                    </a>
            </div>
</c:forEach>
        </div>
    </div>
    <div class="m-body">
        <div class="content-title">
            <h2>全部</h2>
        </div>
        <div class="content-l">
<c:forEach items="${ itemList }" var="i" varStatus="s">
            <div class="content-l-item">
                <a href="${ pageContext.request.contextPath}/welcome?entityName=${ entityName}&id=${ i.id}" >
                    <img src="${ pageContext.request.contextPath}/file?filename=${ i.showpic}">
                    <p class="content-l-item-title">${ i.showtitle}</p>
                    <p class="content-l-item-tip">${ i.showdesc}</p>
                </a>
                <a href="javascript:star('${ i.id}');">
                    <p class="content-l-item-tip">收藏</p>
                </a>
            </div>
</c:forEach>
        </div>
    </div>
</div>


<jsp:include page="./c-foot.jsp"></jsp:include>

</body>
</html>
